/**
 * 公共样式
 */
$baseThemeColor: (
  0: #000,
  1: #111,
  2: #222,
  3: #333,
  4: #444,
  5: #555,
  6: #666,
  7: #777,
  8: #888,
  9: #999,
  white: #fff,
  red: red,
  green: green,
  yellow: yellow,
  primary: var(--el-color-primary),
  secondary: var(--el-color-secondary),
  success: var(--el-color-success),
  warning: var(--el-color-warning),
  danger: var(--el-color-danger),
  error: var(--el-color-error),
  info: var(--el-color-info),
  transparent: transparent
);

$zIndex: (
  1: 1,
  10: 10,
  100: 100,
  500: 500,
  1000: 1000,
  1500: 1500,
  2000: 2000,
  3000: 3000
);

$fontWeight: (
  100: 100,
  200: 200,
  300: 300,
  400: 400,
  500: 500,
  600: 600,
  700: 700,
  800: 800,
  900: 900
);

@each $c, $cv in $fontWeight {
  // color
  .f-w-#{$c} {
    font-weight: #{$cv};
  }
}

@each $c, $cv in $baseThemeColor {
  // color
  .color-#{"" + $c} {
    color: #{$cv};
  }
  // background-color
  .bg-color-#{"" + $c} {
    background-color: #{$cv};
  }
}

@each $c, $cv in $zIndex {
  // z-index
  .z-index-#{$c} {
    z-index: #{$cv};
  }
}

@for $i from 8 through 40 {
  // font-size
  .f-s-#{$i} {
    font-size: #{$i}px;
  }
}

@for $i from 1 through 10 {
  // background-color-opacity
  .bg-opacity-#{$i} {
    background-color: rgba(0, 0, 0, $i * 0.1);
  }
  // border-radius
  .b-r-#{$i * 5} {
    border-radius: #{$i * 5}px;
  }
  // letter-spacing
  .l-s-#{$i} {
    letter-spacing: #{$i}px;
  }
}

@for $i from 1 through 5 {
  // box-shadow
  .b-s-#{$i*5} {
    box-shadow: 0 0 $i * 5px rgba(153, 153, 153, 0.5);
  }
  // ellipsis
  .ellipsis-#{$i} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: #{$i}; /* 这里是超出几行省略 */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@for $i from 0 through 9 {
  // opacity actives
  .opacity-#{$i},
  .actives-#{$i}:active {
    opacity: $i * 0.1;
  }
  // transition
  .transition-#{$i} {
    transition: all $i * 0.1s;
  }
}

@for $i from 5 through 9 {
  // transform-scale
  .transform-scale-#{$i} {
    transform: scale($i * 0.1);
  }
}

// 0 - 60 => 5的倍数
@for $i from 0 through 60 {
  @if ($i % 5)==0 {
    // padding
    .p-a-#{$i} {
      padding: #{$i}px
    }
    .p-t-#{$i} {
      padding-top: #{$i}px;
    }
    .p-r-#{$i} {
      padding-right: #{$i}px;
    }
    .p-b-#{$i} {
      padding-bottom: #{$i}px;
    }
    .p-l-#{$i} {
      padding-left: #{$i}px;
    }
    // margin
    .m-a-#{$i} {
      margin: #{$i}px
    }
    .m-t-#{$i} {
      margin-top: #{$i}px;
    }
    .m-r-#{$i} {
      margin-right: #{$i}px;
    }
    .m-b-#{$i} {
      margin-bottom: #{$i}px;
    }
    .m-l-#{$i} {
      margin-left: #{$i}px;
    }
    // line-height
    .l-h-#{$i} {
      line-height: #{$i}px;
    }
    // top
    .top-#{$i} {
      top: #{$i}px;
    }
    // bottom
    .bottom-#{$i} {
      bottom: #{$i}px;
    }
    // left
    .left-#{$i} {
      left: #{$i}px;
    }
    // right
    .right-#{$i} {
      right: #{$i}px;
    }
  }
  // width
  .w-#{$i*5} {
    width: #{$i*5}px;
  }
  .min-w-#{$i*5} {
    min-width: #{$i*5}px;
  }
  .max-w-#{$i*5} {
    max-width: #{$i*5}px;
  }
  // height
  .h-#{$i*5} {
    height: #{$i*5}px;
  }
  .min-h-#{$i*5} {
    min-height: #{$i*5}px;
  }
  .max-h-#{$i*5} {
    max-height: #{$i*5}px;
  }
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.font-weight {
  font-weight: bolder;
}

.white-space-nowrap {
  white-space: nowrap;
}

.text-decoration-line-through {
  text-decoration-line: line-through;
}

.text-decoration-underline {
  text-decoration: underline;
}

.word-break-all {
  word-break: break-all;
}

.word-break-word {
  word-break: break-word;
}

.word-break-keep {
  word-break: keep-all;
}

/* float */
.float-left {
  float: left;
}

.float-right {
  float: right;
}

.clear-both {
  clear: both;
}

.clear-both-after::after {
  content: '';
  display: block;
  clear: both;
}

/* flex */
.flex {
  display: flex;
}

.flex1 {
  flex: 1;
}

.flex2 {
  flex: 2;
}

.flex3 {
  flex: 3;
}

.flex4 {
  flex: 4;
}

.flex5 {
  flex: 5;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-justify {
  justify-content: center;
}

.flex-align {
  align-items: center;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-justify-start {
  justify-content: flex-start;
}

.flex-justify-center {
  justify-content: center;
}

.flex-justify-end {
  justify-content: flex-end;
}

.flex-justify-space-between {
  justify-content: space-between;
}

.align-items-start {
  align-items: flex-start;
}

.align-items-center {
  align-items: center;
}

.align-items-end {
  align-items: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.text-align-left {
  text-align: left;
}

.text-align-center {
  text-align: center;
}

.text-align-right {
  text-align: right;
}

/* overflow */
.overflow-auto {
  overflow: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.overflow-y-hidden {
  overflow-y: hidden;
}

.overflow-x-scroll {
  overflow-x: scroll;
}

.overflow-y-scroll {
  overflow-y: scroll;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* display */
.display-block {
  display: block;
}

.display-none {
  display: none;
}

.display-inline-block {
  display: inline-block;
}

.display-inherit {
  display: inherit;
}

/* position */
.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

.position-fixed {
  position: fixed;
}

/* box-sizing */
.box-sizing {
  box-sizing: border-box;
}

.box-sizing-content-box {
  box-sizing: content-box;
}

.box-sizing-inherit {
  box-sizing: inherit;
}

.box-sizing-initial {
  box-sizing: initial;
}

.box-sizing-unset {
  box-sizing: unset;
}

/* text-indent */
.text-indent1 {
  text-indent: 1em;
}

.text-indent2 {
  text-indent: 2em;
}

/* cursor */
.cursor-pointer {
  cursor: pointer;
}
.cursor-move {
  cursor: move;
}